//
//  Config.m
//  JCMO
//
//  Created by YangXiao on 16/3/2.
//  Copyright © 2016年 JCreate. All rights reserved.
//

#import "Config.h"

@implementation Config
+(void)userDefaultsSetObject:(id)object key:(NSString *)key
{
    [[NSUserDefaults standardUserDefaults] setObject:object forKey:key];
    [[NSUserDefaults standardUserDefaults] synchronize];
}


+(id)userDefaultsGetObjectForKey:(NSString *)key
{
    if ([[NSUserDefaults standardUserDefaults] objectForKey:key]) {
        return [[NSUserDefaults standardUserDefaults] objectForKey:key];
    }else{
        return NULL;
    }
}

+(NSString *)Token
{
    return [Config userDefaultsGetObjectForKey:kToken];
}

+(void)SetToken:(NSString *)token
{
    [Config userDefaultsSetObject:token key:kToken];
}

+(BOOL)isLogin
{
    NSString *token = [Config userDefaultsGetObjectForKey:kToken];
    return token?YES:NO;
}

@end
